package com.example.administrator.readbook.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.example.administrator.readbook.greendao.GreenDaoBookBean;
import com.example.administrator.readbook.greendao.GreenDaoReadChapterBean;

import com.example.administrator.readbook.greendao.GreenDaoBookBeanDao;
import com.example.administrator.readbook.greendao.GreenDaoReadChapterBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig greenDaoBookBeanDaoConfig;
    private final DaoConfig greenDaoReadChapterBeanDaoConfig;

    private final GreenDaoBookBeanDao greenDaoBookBeanDao;
    private final GreenDaoReadChapterBeanDao greenDaoReadChapterBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        greenDaoBookBeanDaoConfig = daoConfigMap.get(GreenDaoBookBeanDao.class).clone();
        greenDaoBookBeanDaoConfig.initIdentityScope(type);

        greenDaoReadChapterBeanDaoConfig = daoConfigMap.get(GreenDaoReadChapterBeanDao.class).clone();
        greenDaoReadChapterBeanDaoConfig.initIdentityScope(type);

        greenDaoBookBeanDao = new GreenDaoBookBeanDao(greenDaoBookBeanDaoConfig, this);
        greenDaoReadChapterBeanDao = new GreenDaoReadChapterBeanDao(greenDaoReadChapterBeanDaoConfig, this);

        registerDao(GreenDaoBookBean.class, greenDaoBookBeanDao);
        registerDao(GreenDaoReadChapterBean.class, greenDaoReadChapterBeanDao);
    }
    
    public void clear() {
        greenDaoBookBeanDaoConfig.clearIdentityScope();
        greenDaoReadChapterBeanDaoConfig.clearIdentityScope();
    }

    public GreenDaoBookBeanDao getGreenDaoBookBeanDao() {
        return greenDaoBookBeanDao;
    }

    public GreenDaoReadChapterBeanDao getGreenDaoReadChapterBeanDao() {
        return greenDaoReadChapterBeanDao;
    }

}
